package com.sfh.service.model;

import java.util.Date;

import com.sfh.service.model.table.MessageTable;

public class MessageModel extends BaseModel<MessageModel> {
	public static final MessageModel MESSAGE = new MessageModel().dao();
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public MessageModel findById(Object idValue) {
		return super.findFirst("select * from "+MessageTable.Table+" where "+MessageTable.id+"=?", idValue);
	}
	
	
	public long getId() {
		return this.getLong(MessageTable.id.toString());
	}
	public void setId(long id) {
		this.set(MessageTable.id.toString(), id);
	}
	
	public Date getTime() {
		return this.get(MessageTable.time.toString());
	}
	public void setTime(Date time) {
		this.set(MessageTable.time.toString(), time);
	}
	
	public String getContent() {
		return this.get(MessageTable.content.toString());
	}
	public void setContent(String content) {
		this.set(MessageTable.content.toString(), content);
	}
	
	public long getNoteId() {
		return this.getLong(MessageTable.noteId.toString());
	}
	public void setNoteId(long noteId) {
		this.set(MessageTable.noteId.toString(), noteId);
	}
	
	public long getUserId() {
		return this.getLong(MessageTable.userId.toString());
	}
	public void setUserId(long userId) {
		this.set(MessageTable.userId.toString(), userId);
	}

	public long getVersion() {
		return this.getLong(MessageTable.version.toString());
	}
	public void setVersion(long version) {
		this.set(MessageTable.version.toString(), version);
	}
	
	public long getMassId() {
		return this.getLong(MessageTable.massId.toString());
	}
	public void setMassId(long massId) {
		this.set(MessageTable.massId.toString(), massId);
	}
	
	
	/**
	 * 获取创建人
	 * @return
	 */
	public UserModel getExtUser()
	{
		return  UserModel.USER.findById(this.getUserId());
	}
	
}
